<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>订单管理 - 管理系统</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
    <style>
        :root {
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --accent-color: #e74c3c;
            --light-color: #ecf0f1;
            --dark-color: #34495e;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }
        
        body {
            background-color: #f5f7fa;
            color: #333;
            padding: 20px;
        }
        
        .page-container {
            max-width: 1400px;
            margin: 0 auto;
        }
        
        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .page-title {
            font-size: 24px;
            font-weight: 500;
            color: var(--secondary-color);
            display: flex;
            align-items: center;
        }
        
        .page-title i {
            margin-right: 10px;
            color: var(--primary-color);
        }
        
        .card {
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            margin-bottom: 20px;
            overflow: hidden;
        }
        
        .card-header {
            padding: 15px 20px;
            border-bottom: 1px solid #eee;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .card-header h3 {
            font-weight: 500;
            font-size: 16px;
        }
        
        .card-body {
            padding: 20px;
        }
        
        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s;
            display: inline-flex;
            align-items: center;
        }
        
        .btn i {
            margin-right: 5px;
        }
        
        .btn-primary {
            background-color: var(--primary-color);
            color: white;
        }
        
        .btn-primary:hover {
            background-color: #2980b9;
        }
        
        .btn-outline {
            background: transparent;
            border: 1px solid #ddd;
            color: #555;
        }
        
        .btn-outline:hover {
            background-color: #f8f9fa;
        }
        
        .btn-success {
            background-color: #28a745;
            color: white;
        }
        
        .btn-success:hover {
            background-color: #218838;
        }
        
        .btn-danger {
            background-color: var(--accent-color);
            color: white;
        }
        
        .btn-danger:hover {
            background-color: #c82333;
        }
        
        .table {
            width: 100%;
            border-collapse: collapse;
        }
        
        .table th, .table td {
            padding: 12px 15px;
            text-align: left;
            border-bottom: 1px solid #eee;
        }
        
        .table th {
            background-color: #f8f9fa;
            font-weight: 500;
            color: #555;
            white-space: nowrap;
        }
        
        .table tr:hover {
            background-color: #f8f9fa;
        }
        
        .badge {
            display: inline-block;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 500;
        }
        
        .badge-primary {
            background-color: #d1ecf1;
            color: #0c5460;
        }
        
        .badge-success {
            background-color: #d4edda;
            color: #155724;
        }
        
        .badge-warning {
            background-color: #fff3cd;
            color: #856404;
        }
        
        .badge-danger {
            background-color: #f8d7da;
            color: #721c24;
        }
        
        .badge-info {
            background-color: #d1ecf1;
            color: #0c5460;
        }
        
        .search-filter {
            display: flex;
            margin-bottom: 20px;
            gap: 10px;
            flex-wrap: wrap;
        }
        
        .form-control {
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            transition: border-color 0.3s;
        }
        
        .form-control:focus {
            border-color: var(--primary-color);
            outline: none;
        }
        
        .select-control {
            min-width: 150px;
        }
        
        .date-range {
            display: flex;
            align-items: center;
        }
        
        .date-range span {
            margin: 0 10px;
            color: #777;
        }
        
        .pagination {
            display: flex;
            justify-content: flex-end;
            margin-top: 20px;
        }
        
        .page-item {
            margin: 0 5px;
        }
        
        .page-link {
            padding: 6px 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            color: var(--primary-color);
            text-decoration: none;
            transition: all 0.3s;
        }
        
        .page-link:hover {
            background-color: #f8f9fa;
        }
        
        .page-item.active .page-link {
            background-color: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }
        
        .action-dropdown {
            position: relative;
            display: inline-block;
        }
        
        .action-btn {
            padding: 5px 10px;
            background: #f8f9fa;
            border: 1px solid #ddd;
            border-radius: 4px;
            cursor: pointer;
        }
        
        .dropdown-menu {
            position: absolute;
            right: 0;
            background: white;
            min-width: 150px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            border-radius: 4px;
            z-index: 100;
            display: none;
        }
        
        .dropdown-menu.show {
            display: block;
        }
        
        .dropdown-item {
            padding: 8px 15px;
            display: block;
            color: #333;
            text-decoration: none;
            transition: all 0.2s;
        }
        
        .dropdown-item:hover {
            background-color: #f8f9fa;
            color: var(--primary-color);
        }
        
        .dropdown-divider {
            height: 1px;
            background-color: #eee;
            margin: 5px 0;
        }
        
        .order-detail {
            display: none;
            background: #f9f9f9;
            padding: 15px;
            margin-top: 10px;
            border-radius: 4px;
        }
        
        .order-detail.show {
            display: block;
        }
        
        .detail-row {
            display: flex;
            margin-bottom: 10px;
        }
        
        .detail-label {
            width: 120px;
            font-weight: 500;
            color: #666;
        }
        
        .detail-value {
            flex: 1;
        }
        
        .product-list {
            width: 100%;
            border-collapse: collapse;
            margin-top: 10px;
        }
        
        .product-list th {
            background: #f1f1f1;
            padding: 8px;
            text-align: left;
        }
        
        .product-list td {
            padding: 8px;
            border-bottom: 1px solid #eee;
        }
        
        .product-img {
            width: 50px;
            height: 50px;
            object-fit: cover;
            border-radius: 4px;
        }
        
        @media (max-width: 768px) {
            .table-responsive {
                overflow-x: auto;
            }
            
            .search-filter {
                flex-direction: column;
            }
            
            .date-range {
                flex-direction: column;
                align-items: flex-start;
            }
            
            .date-range span {
                display: none;
            }
        }
    </style>
</head>
<body>
    <div class="page-container">
        <div class="page-header">
            <h1 class="page-title">
                <i class="bi bi-cart"></i>
                订单管理
            </h1>
            <div>
                <button class="btn btn-primary">
                    <i class="bi bi-plus"></i>
                    新增订单
                </button>
            </div>
        </div>
        
        <div class="card">
            <div class="card-header">
                <h3>订单筛选</h3>
            </div>
            <div class="card-body">
                <div class="search-filter">
                    <input type="text" class="form-control" placeholder="订单编号/客户名称" style="flex: 1; min-width: 200px;">
                    
                    <select class="form-control select-control">
                        <option value="">所有状态</option>
                        <option value="pending">待付款</option>
                        <option value="paid">已付款</option>
                        <option value="shipped">已发货</option>
                        <option value="completed">已完成</option>
                        <option value="cancelled">已取消</option>
                        <option value="refunded">已退款</option>
                    </select>
                    
                    <select class="form-control select-control">
                        <option value="">所有渠道</option>
                        <option value="website">官网</option>
                        <option value="app">APP</option>
                        <option value="wechat">微信小程序</option>
                        <option value="offline">线下</option>
                    </select>
                    
                    <div class="date-range">
                        <input type="date" class="form-control">
                        <span>至</span>
                        <input type="date" class="form-control">
                    </div>
                    
                    <button class="btn btn-primary">
                        <i class="bi bi-search"></i>
                        搜索
                    </button>
                    
                    <button class="btn btn-outline">
                        <i class="bi bi-arrow-clockwise"></i>
                        重置
                    </button>
                </div>
            </div>
        </div>
        
        <div class="card">
            <div class="card-header">
                <h3>订单列表</h3>
                <div>
                    <button class="btn btn-outline">
                        <i class="bi bi-download"></i>
                        导出
                    </button>
                </div>
            </div>
            <div class="card-body">
                <div class="table-responsive">
                    <table class="table">
                        <thead>
                            <tr>
                                <th>订单编号</th>
                                <th>客户</th>
                                <th>日期</th>
                                <th>金额</th>
                                <th>状态</th>
                                <th>渠道</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>ORD-20230615-001</td>
                                <td>李小明</td>
                                <td>2023-06-15</td>
                                <td>¥1,288.00</td>
                                <td><span class="badge badge-success">已完成</span></td>
                                <td>官网</td>
                                <td>
                                    <div class="action-dropdown">
                                        <button class="action-btn" onclick="toggleDropdown(this)">
                                            <i class="bi bi-three-dots"></i>
                                        </button>
                                        <div class="dropdown-menu">
                                            <a href="#" class="dropdown-item" onclick="showOrderDetail('detail1')">
                                                <i class="bi bi-eye"></i> 查看详情
                                            </a>
                                            <a href="#" class="dropdown-item">
                                                <i class="bi bi-printer"></i> 打印订单
                                            </a>
                                            <a href="#" class="dropdown-item">
                                                <i class="bi bi-truck"></i> 发货
                                            </a>
                                            <div class="dropdown-divider"></div>
                                            <a href="#" class="dropdown-item" style="color: var(--accent-color);">
                                                <i class="bi bi-x-circle"></i> 取消订单
                                            </a>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="7" class="p-0">
                                    <div id="detail1" class="order-detail">
                                        <div class="detail-row">
                                            <div class="detail-label">收货信息:</div>
                                            <div class="detail-value">
                                                李小明，13800138000，北京市朝阳区建国路88号SOHO现代城A座1001室
                                            </div>
                                        </div>
                                        <div class="detail-row">
                                            <div class="detail-label">支付方式:</div>
                                            <div class="detail-value">微信支付</div>
                                        </div>
                                        <div class="detail-row">
                                            <div class="detail-label">配送方式:</div>
                                            <div class="detail-value">顺丰快递 (SF123456789)</div>
                                        </div>
                                        <div class="detail-row">
                                            <div class="detail-label">备注:</div>
                                            <div class="detail-value">周末送货，请提前电话联系</div>
                                        </div>
                                        
                                        <table class="product-list">
                                            <thead>
                                                <tr>
                                                    <th>商品</th>
                                                    <th>单价</th>
                                                    <th>数量</th>
                                                    <th>小计</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <tr>
                                                    <td>
                                                        <div style="display: flex; align-items: center;">
                                                            <img src="https://via.placeholder.com/50" class="product-img" alt="商品图片">
                                                            <div style="margin-left: 10px;">
                                                                <div>高端无线蓝牙耳机</div>
                                                                <div style="font-size: 12px; color: #777;">型号: BT-2023</div>
                                                            </div>
                                                        </div>
                                                    </td>
                                                    <td>¥599.00</td>
                                                    <td>2</td>
                                                    <td>¥1,198.00</td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <div style="display: flex; align-items: center;">
                                                            <img src="https://via.placeholder.com/50" class="product-img" alt="商品图片">
                                                            <div style="margin-left: 10px;">
                                                                <div>Type-C 数据线</div>
                                                                <div style="font-size: 12px; color: #777;">型号: TC-001</div>
                                                            </div>
                                                        </div>
                                                    </td>
                                                    <td>¥45.00</td>
                                                    <td>2</td>
                                                    <td>¥90.00</td>
                                                </tr>
                                            </tbody>
                                            <tfoot>
                                                <tr>
                                                    <td colspan="3" style="text-align: right; font-weight: 500;">商品总额:</td>
                                                    <td>¥1,288.00</td>
                                                </tr>
                                                <tr>
                                                    <td colspan="3" style="text-align: right; font-weight: 500;">运费:</td>
                                                    <td>¥0.00</td>
                                                </tr>
                                                <tr>
                                                    <td colspan="3" style="text-align: right; font-weight: 500;">优惠:</td>
                                                    <td>-¥0.00</td>
                                                </tr>
                                                <tr>
                                                    <td colspan="3" style="text-align: right; font-weight: 500;">实付金额:</td>
                                                    <td style="font-weight: 600;">¥1,288.00</td>
                                                </tr>
                                            </tfoot>
                                        </table>
                                    </div>
                                </td>
                            </tr>
                            
                            <tr>
                                <td>ORD-20230614-002</td>
                                <td>王小红</td>
                                <td>2023-06-14</td>
                                <td>¥899.00</td>
                                <td><span class="badge badge-primary">已发货</span></td>
                                <td>微信小程序</td>
                                <td>
                                    <div class="action-dropdown">
                                        <button class="action-btn" onclick="toggleDropdown(this)">
                                            <i class="bi bi-three-dots"></i>
                                        </button>
                                        <div class="dropdown-menu">
                                            <a href="#" class="dropdown-item">
                                                <i class="bi bi-eye"></i> 查看详情
                                            </a>
                                            <a href="#" class="dropdown-item">
                                                <i class="bi bi-printer"></i> 打印订单
                                            </a>
                                            <a href="#" class="dropdown-item">
                                                <i class="bi bi-check-circle"></i> 确认收货
                                            </a>
                                            <div class="dropdown-divider"></div>
                                            <a href="#" class="dropdown-item">
                                                <i class="bi bi-truck"></i> 查看物流
                                            </a>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            
                            <tr>
                                <td>ORD-20230613-003</td>
                                <td>张伟</td>
                                <td>2023-06-13</td>
                                <td>¥2,499.00</td>
                                <td><span class="badge badge-warning">待付款</span></td>
                                <td>APP</td>
                                <td>
                                    <div class="action-dropdown">
                                        <button class="action-btn" onclick="toggleDropdown(this)">
                                            <i class="bi bi-three-dots"></i>
                                        </button>
                                        <div class="dropdown-menu">
                                            <a href="#" class="dropdown-item">
                                                <i class="bi bi-eye"></i> 查看详情
                                            </a>
                                            <a href="#" class="dropdown-item">
                                                <i class="bi bi-printer"></i> 打印订单
                                            </a>
                                            <div class="dropdown-divider"></div>
                                            <a href="#" class="dropdown-item" style="color: var(--accent-color);">
                                                <i class="bi bi-x-circle"></i> 取消订单
                                            </a>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            
                            <tr>
                                <td>ORD-20230612-004</td>
                                <td>刘芳</td>
                                <td>2023-06-12</td>
                                <td>¥1,599.00</td>
                                <td><span class="badge badge-info">已付款</span></td>
                                <td>官网</td>
                                <td>
                                    <div class="action-dropdown">
                                        <button class="action-btn" onclick="toggleDropdown(this)">
                                            <i class="bi bi-three-dots"></i>
                                        </button>
                                        <div class="dropdown-menu">
                                            <a href="#" class="dropdown-item">
                                                <i class="bi bi-eye"></i> 查看详情
                                            </a>
                                            <a href="#" class="dropdown-item">
                                                <i class="bi bi-printer"></i> 打印订单
                                            </a>
                                            <a href="#" class="dropdown-item">
                                                <i class="bi bi-truck"></i> 发货
                                            </a>
                                            <div class="dropdown-divider"></div>
                                            <a href="#" class="dropdown-item" style="color: var(--accent-color);">
                                                <i class="bi bi-x-circle"></i> 取消订单
                                            </a>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            
                            <tr>
                                <td>ORD-20230610-005</td>
                                <td>陈明</td>
                                <td>2023-06-10</td>
                                <td>¥3,299.00</td>
                                <td><span class="badge badge-danger">已退款</span></td>
                                <td>线下</td>
                                <td>
                                    <div class="action-dropdown">
                                        <button class="action-btn" onclick="toggleDropdown(this)">
                                            <i class="bi bi-three-dots"></i>
                                        </button>
                                        <div class="dropdown-menu">
                                            <a href="#" class="dropdown-item">
                                                <i class="bi bi-eye"></i> 查看详情
                                            </a>
                                            <a href="#" class="dropdown-item">
                                                <i class="bi bi-printer"></i> 打印订单
                                            </a>
                                            <div class="dropdown-divider"></div>
                                            <a href="#" class="dropdown-item">
                                                <i class="bi bi-receipt"></i> 退款详情
                                            </a>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                
                <div class="pagination">
                    <div class="page-item">
                        <a href="#" class="page-link">
                            <i class="bi bi-chevron-left"></i>
                        </a>
                    </div>
                    <div class="page-item active">
                        <a href="#" class="page-link">1</a>
                    </div>
                    <div class="page-item">
                        <a href="#" class="page-link">2</a>
                    </div>
                    <div class="page-item">
                        <a href="#" class="page-link">3</a>
                    </div>
                    <div class="page-item">
                        <a href="#" class="page-link">4</a>
                    </div>
                    <div class="page-item">
                        <a href="#" class="page-link">5</a>
                    </div>
                    <div class="page-item">
                        <a href="#" class="page-link">
                            <i class="bi bi-chevron-right"></i>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 切换下拉菜单
        function toggleDropdown(button) {
            const dropdown = button.nextElementSibling;
            const isShowing = dropdown.classList.contains('show');
            
            // 关闭所有其他打开的下拉菜单
            document.querySelectorAll('.dropdown-menu.show').forEach(menu => {
                if (menu !== dropdown) {
                    menu.classList.remove('show');
                }
            });
            
            // 切换当前下拉菜单
            if (!isShowing) {
                dropdown.classList.add('show');
            } else {
                dropdown.classList.remove('show');
            }
        }
        
        // 点击页面其他地方关闭下拉菜单
        document.addEventListener('click', function(e) {
            if (!e.target.closest('.action-dropdown')) {
                document.querySelectorAll('.dropdown-menu.show').forEach(menu => {
                    menu.classList.remove('show');
                });
            }
        });
        
        // 显示/隐藏订单详情
        function showOrderDetail(id) {
            const detail = document.getElementById(id);
            detail.classList.toggle('show');
            
            // 关闭所有其他订单详情
            document.querySelectorAll('.order-detail').forEach(item => {
                if (item.id !== id && item.classList.contains('show')) {
                    item.classList.remove('show');
                }
            });
            
            // 阻止事件冒泡
            event.stopPropagation();
            return false;
        }
    </script>
</body>
</html>